DeskEdit

by Lee Calcraft

Note: clicking on references from the following list will take you to the appropriate section, whilst clicking on the main headings within the manual will return the view to this list of contents.

Contents

1

Introduction

1.1

 

Getting Started

1.2

 

Editing Text

1.3

 

Marking Text

1.4

 

Input focus

1.5

 

Updating !System

2

The Window Menu Entries (Upper)

2.1

 

Misc

2.2

 

Save

2.3

 

Select

2.4

 

Edit (including Search)

2.5

 

Display

3

The Window Menu Entries (Lower)

3.1

 

Help

3.2

 

Language

3.21
  
Macros and Key-based Features
3.22
  
Auto Indent
3.23
  
Basic Import/Export
3.24
  
Syntax Checking

3.3

 

Quick Search

3.4

 

Clipboard

3.5

 

Markers, Position Finding and Indexing

3.6

 

Set Filetype

3.7

 

Text Macros

3.8

 

Printing

3.81
  
Printer Codes
3.82
  
Page Setup
3.83
  
Headers and Footers
3.84
  
The Hardcopy Option

3.9

 

User commands

4

The Icon Bar Menu

4.1

 

Info, Help, Quit etc.

4.2

 

User Choices

4.3

 

Create New Object

5

Miscellaneous Features

5.1

 

Entering Control Codes

5.2

 

Undelete

5.3

 

The Dragging Options - File Info & CSD

5.4

 

Caret Controller

5.5

 

DeskEdit$Options

6

Getting the Most from DeskEdit

6.1

 

Working with Text

6.2

 

Working with Basic

6.3

 

Working with C Source Code

7

Keyboard Shortcuts

1 Introduction

DeskEdit is a powerful editor, suitable for writing and editing all kinds of text documents, program source files including those written in Basic or C, and script files such as those used in !Boot and !Run files. It is fully multi-tasking, bringing all the advantages of Acorn's excellent desktop environment. It contains a vast array of features, many of which may be invoked either from standard menus or by using keyboard shortcuts. To assist with the latter, a function keystrip is provided.

With only one exception (DeskEdit has no Task window), the features of Acorn's Edit text editor form a complete subset of those offered by DeskEdit. Moreover Edit's menu structure and keyboard shortcuts have been retained almost in their entirety, so that users familiar with this useful package will have no relearning to do. In this manual, the features of DeskEdit which echo those of Edit will be treated more briefly than its new features, and if the user is unfamiliar with Edit, he will find additional information in the RISC OS User Guide.

1.1 Getting Started

Before using DeskEdit, please run the ReadMe application on the DeskEdit disc by double-clicking on its icon in the directory viewer. This application will tell you about any enhancements or modifications made to DeskEdit since this manual was written.

To install DeskEdit in your machine, insert the DeskEdit disc, and click on the floppy drive icon. Then double-click on the DeskEdit icon in the directory viewer. This will install DeskEdit's icon on the icon bar.

If you get the error message "Old C Library" when you first run DeskEdit, you will need to update your current version of the C Library file CLib (see section 1.5).

When first installed, DeskEdit's icon will initially incorporate the letter "T" to indicate that it is in Text mode. This mode is used for editing all types of file except for Basic programs and C source code. If a Basic program is loaded into DeskEdit, a letter "B" will be displayed, while C source code will cause a "C" to appear on the icon. A number of DeskEdit's features depend on the current language mode - further details are given in sections 3.2 and 6.

Once DeskEdit has been installed on the icon bar, clicking on its icon with the left-hand or Select button of the mouse will open a new DeskEdit window. By default the window will be in Text mode, and you may type into it to create a text file.

As with with other RISC OS applications, the middle or Menu button of the mouse is used to invoke DeskEdit's menus. There are two of these: one on the icon bar icon, and one in each DeskEdit window that is opened. The latter generally control window-specific features of the package, while the former invoke general features.

To install DeskEdit onto a hard disc, simply open the target directory on your hard disc, and drag DeskEdit's icon from its directory viewer on the DeskEdit floppy disc to the required destination.

Note that you may run DeskEdit from an Obey file with a simple line such as:

When running it in this way, you may supply up to six filenames of files which will automatically be loaded as DeskEdit boots up. For example: This would install DeskEdit on the icon bar, and load the two files MyCorresp and PhoneBook into separate DeskEdit windows ready for editing.

Loading and Saving
To load a file into DeskEdit at other times, simply drag the file's icon to DeskEdit's icon on the icon bar. A new window will be opened, and the file will be loaded into it ready for editing. This will even work if the file is a Basic program: DeskEdit will automatically de-tokenise it (to render it into an editable form), and optionally strip its line numbers (see sections 3.2 and 6.2 below).

To save a file, click with the Menu button over the window containing the file, and move the pointer across the Save entry. Alternatively, just press function key F3. Now optionally edit the name which appears in the "Save as" box, and drag the file's icon to the directory viewer of your choice. If the file already has a full pathname (because it has been loaded from a viewer, or has previously been saved), clicking on "OK" or pressing Return will save it.

To save a Basic program that you have been editing (and re-tokenise it ready for running), either use F3, or move the pointer across the Language entry in the window menu, and then across the Basic and Save submenu entries.

1.2 Editing Text

Text may be typed into any DeskEdit window, and edited in the normal way. The Delete key (and also the Backspace key - usually at the top-right of the main keyboard), deletes backwards. The Copy (or End) key deletes forward one character at a time, while Shift-Copy deletes forward to the end of the current word, and Ctrl-Copy deletes the current line.

By default, DeskEdit starts up in so-called Insert mode. Characters typed will be inserted, and any text to the right of the caret will be moved along to make room. In Overtype mode, text typed at the caret will replace text already present. To toggle between the two modes, use Shift-F1. If you are in Overwrite mode, the word "Overwrite" will appear in the window's title bar.

You can move around the text a character at a time using the Left, Right, Up and Down cursor keys. Shift-Left and Shift-Right move the caret one word at a time, and Ctrl-Left and Ctrl-Right take you to the start or the end of a line or paragraph.

Shift-Up and Shift-Down behave in the same way as Page up and Page down, moving up or down the text by a screenful. Finally Ctrl-Up and Ctrl-Down take you to the very top or very bottom of text (as does Home and Ctrl-Home).

If you hold down both Shift and Ctrl keys when using the Up or Down cursor keys, the text rather than the caret is moved. This can be useful if the caret is at the bottom of a window, say, and you want to look at text beyond the top of the window. Pressing Ctrl-Shift-Up will scroll the text into view without your having to wait for the caret to crawl up the screen first.

If the pointer obscures your view at any time, you can park it at the right-hand edge of the screen instantly by pressing the Break key. This is a handy shortcut if you happen to have both hands at the keyboard. Incidentally, if you cannot find the caret at any time, just press Shift-Escape and it will flash rapidly for a couple of seconds (even if Caret flash is not enabled - see section 5.4).

1.3 Marking Text

For certain editing operations such as Copy or Move text, it is first necessary to mark (or "select") the target text. This is done exactly as in Edit. You can simply drag the pointer over the required text, moving downwards to mark large tracts. Alternatively, you can double-click to mark a word, or triple-click to mark a line. In a third method, you can click one end of a block with Select, and the other with Adjust (but you must clear any previously marked area first - pressing Escape will achieve this).

DeskEdit provides a further way to mark text for situations where you are not already holding the mouse. Ctrl-M will mark the character at the caret, and continue to extend the marking as long as Ctrl-M is pressed. Ctrl-Shift-M will mark a line at a time in a similar way.

To deselect a marked area, use Ctrl-Z. Alternatively, just press Escape.

1.4 Input focus

A window (or icon) is said to have Input focus if the caret (the Archimedes' slim vertical cursor) is located within it. Only one window or icon can have input focus at any one time; and to show which window possesses the focus, its title bar background is coloured cream. Keyboard shortcuts apply to the window which has input focus; and if no DeskEdit window has input focus, then the shortcut key combinations will have no effect.

DeskEdit's window menu is split into two sections divided by a dashed line, with the upper part closely following the functions of Edit. As with Edit, the window to which a given feature (in the upper part of the menu) applies is determined by the window over which the Menu button was clicked, even if that window does not have input focus. This can sometimes be a little confusing.

The features of DeskEdit controlled by the lower part of the menu may only be applied to a window with the input focus. The only consequence of this is that if you click Menu over a DeskEdit window which does not have input focus, many of the options will appear shaded on the menu, and will not be selectable. At this point, simply click with Select on the window which interests you, and then click Menu anywhere over that window (or press the appropriate shortcut key).

1.5 Updating !System

A special application called !Merge is supplied on the DeskEdit disc for updating your !System application so that it contains the latest version of the C library CLib. You only need to follow this procedure if when you first run DeskEdit you get a message to the effect that your version of CLib is out of date.

To update your !System application, first remove any applications which you may have running from the Desktop (since changing CLib while they are running could cause them to crash), then double-click on the !Merge application, and follow the instructions which appear in the dialogue box. Essentially you must first drag your own !System application to the Merge dialogue box, and then drag the "New" DeskEdit !System to it - and the job will be done for you. You will be prompted to insert floppy discs, as appropriate.

2 Window Menu Entries (Upper)

Sections 2, 3 and 4 of this manual cover the major features of DeskEdit which may be accessed from DeskEdit's window and icon bar menus. The order of presentation follows that of the menus themselves.

In many cases the features described can be accessed either via the menu system or through keyboard shortcuts. Where the latter are not function key related, and therefore do not appear on the function keystrip, you may find it best to ignore the shortcuts until you are more familiar with the package. In any case, section 7 of this manual summarises these shortcuts - as does the on-screen Help facility.

The present section deals with the upper part of DeskEdit's window menu (the entries above the dashed line).

2.1 Misc

The Misc submenu has six entries, and covers features similar to those found in Edit.

Info
Moving the pointer across this entry puts up the familiar "About this program" box, giving copyright and version number information.

File
Moving the pointer across File puts up an information box about the file contained in the DeskEdit object beneath the pointer. It shows the filetype, length, datestamp and pathname of the object.

New view
Clicking on New view opens a new view on the current text object. This is similar to the New view feature in Edit, but with the small advantage that DeskEdit does not place the two windows horizontally adjacent to each other on the screen. New view provides a second view of the same text object, and you will find that any alterations which you make to one of the views is also reflected in the other.

Column tab
Selecting this option will cause the Column tab entry to become ticked, and the word ColTab to appear in the window title bar. With Column tab on, the effect of the Tab key will be to move the caret to special column positions at intervals of eight places (measured in system font units). With Column tab disabled, the Tab key will move the caret to a position immediately below the start of the next word on the line above. Both modes are useful for creating tables etc. Pressing Shift-F3 also toggles between the two states.

Overwrite
Selecting this option toggles between Overwrite and Insert mode. Pressing Shift-F1 has the same effect. In Insert mode (the default), when you enter text from the keyboard, it is inserted at the caret position, and any text to the right of it is moved along to make room. In Overwrite mode, text to the right of the caret is replaced by the new text. The word Overwrite appears in the window's title bar to warn you that you have selected this mode.

Wordwrap
Selecting Wordwrap toggles Wordwrap on and off, as does Ctrl-F5. In Wordwrap mode, the word Wordwrap appears in the window's title bar, and any text that you type will be wrapped onto the next line once the current line gets too long. Breaks are made intelligently, so that words are not cut in the middle. This is all achieved as you type, and moreover, (unlike Edit) DeskEdit keeps control of the width even while you are editing - so if you edit text in Wordwrap mode, the whole paragraph that you are working on will be altered appropriately, as you type. If you are editing program source code, it is essential to have Wordwrap turned off.

The line length used by the wordwrapping software is that entered with the Format option (see section 2.4 below). By default it is 76, but may be set to any width. If you are not in Wordwrap mode, then text that you type will be cut when the line length reaches the number of characters set for the Work area (see section 2.5 below).

For details of how to use these features for plain text work, see section 6.1.

2.2 Save

To save a DeskEdit file, either press F3 or move the pointer across the Save entry in the window menu. A "Save as" dialogue box will appear. If this is a new file (for example, one created by clicking on DeskEdit's icon on the icon bar), then you will need to supply a name for it - a simple leafname will do (e.g. "Myfile"). Then drag the file icon to the directory of your choice. After you have performed this once (or if the file started life with a full filename) then you can simply click on OK, or press Return to save the file.

Note that if you are editing Basic programs, there are effectively two save options: you can save the file in the expanded (de-tokenised) textual form in which it appears for editing, by using the Save option from the main menu described here, or you can save it as a true Basic program. This latter is preferable, and is achieved either by using F3, or by selecting the Basic Save submenu, via the Language entry on the main window menu (see section 3.23 below).

For further details of using DeskEdit to edit Basic programs, see section 6.2.

2.3 Select

The six entries in the Select submenu are all features which operate upon a text selection. Text may be selected in any of the ways described above. If there is no current selection then the six items in the Select submenu will be shaded, and unselectable.

Save
This option behaves exactly as the Save entry in the main window menu, except that only the selected text will be saved.

Copy
Selecting Copy (or pressing Ctrl-C from the keyboard) will copy the selected section to the current position of the caret. Text may be copied from one DeskEdit window to another with this option.

Clicking Select with the Shift key held down also performs a Copy action.

As a useful alternative to Ctrl-C, Ctrl-B may be used to perform a Copy, and then automatically clear the selection. When you get used to the keyboard shortcuts, you will probably find this a more useful option than Copy on its own.

Move
This works in a similar way to Copy except that the selected text is deleted from its original position after the copy is made, so as to effect a move. You can perform the same operation from the keyboard with Ctrl-V. But there is a subtle difference: Ctrl-V additionally clears the selection.

Delete
This option deletes the selected text. Ctrl-X from the keyboard has the same effect.

Clear
This option clears any selection, leaving the text intact. Ctrl-Z from the keyboard has the same effect. Because this is a frequently performed action, the Escape key has been set up to have the same effect.

Indent
Indent, which may also be performed with Ctrl-Shift-F7, may be used to move a block of selected text by a number of columns (as measured in the system font) to the left or right. If a positive number is entered (without a plus sign), the block will be indented by the number of spaces specified. A negative number will cause the specified number of characters (whether these are spaces or not) to be stripped from the left of each line in the selected block.

Alternatively, if you enter a text string, it will be inserted at the left-hand side of each line.

2.4 Edit

There are seven entries in the Edit submenu. They are mostly concerned with mainstream editing functions, though there are one or two of a miscellaneous nature, which are grouped here for compatibility with Edit.

Find
This selection invokes a powerful search and replace tool. It has three modes of operation: and these will be dealt with in turn. All three modes may be invoked from the keyboard using F4 or Shift-F4. The former searches from the current position of the caret downwards, while the latter starts searching from the top of text. See also section 3.3, Quick Search.

By default, the Find dialogue box starts up in Simple mode. Clicking on Magic characters puts it into Edit emulation mode, while clicking on Wildcarded expressions selects Power search mode.

Simple Search
To carry out a Simple search, ensure that the Magic characters and the Wildcarded expressions icons are unselected. Now simply enter a search string in the Find icon, and press Return. If you wish to enter a replace string, type this in below the find string. To recall previous Find and Replace strings, just press F2, or click on Previous.

If you wish to make your search case sensitive, click on the Case sensitive icon.

To simply count the occurrences of the target string, click on Count, and the result will be displayed almost instantaneously. Otherwise, clicking on Go, or pressing Return again, will commence the search. If no matching items are found, the words Not found will appear in the dialogue box; otherwise the Text found box will appear. This offers a number of options which may be selected either by clicking on the corresponding icon, or by typing a single letter at the keyboard - usually the first letter in the action word (e.g. "R" for Replace).

The icons have the following meanings:

Thus clicking on Continue, or simply pressing "C" at the keyboard will take you to the next find without replacing the current one. Clicking on Replace or pressing "R" will replace the current find, and take you to the next, while Last replace will replace the current find, and quit the Search and replace mode. The End of file replace option will replace all occurrences to the end of the file.

The useful option Undo ("U") allows you to step back through a sequence of finds, and to undo any replace actions. ReDo ("D") allows you to step forwards again undoing any Undos.

Edit Emulation
Clicking on the Magic characters icon invokes Edit emulation mode. This means that the Find dialogue box reverts to one reminiscent of the original Edit. In this mode, a variety of so-called Magic characters may be entered from the keyboard in building up the Search and Replace strings.

These special key sequences all begin with the backslash character "\"; and in all cases but one, this is followed by one further character. The sequences have the following meanings:

Thus if you search for the string:

this will match "disc09", "disc19", "disc29" - but not "discs9" or "disc91" etc. The sequence "\d" matches any single digit.

If you search for:

and replace this with:
this will replace all occurrences of two adjacent new lines with a single new line. In a piece of text this would effectively remove paragraph breaks.

The special sequence:

signifies "the found string", and may only be used within a Replace string. For example, to put all occurrences of the word "table" into the plural, regardless of case, use a search string of:
and specify the Replace string as:
This simply means that all finds will be replaced by the find itself with an added "s" - so that both "Table" and "table" will be pluralised.

Although these special sequences provide greater power than the Simple search option, they are severely limited in a number of ways. In particular, the use of wildcards is restricted by not being able to specify characters which must not appear in a sequence. This is remedied by the Power search mode.

Power Search
To enter Power search mode, just click on Wildcarded expressions. This brings down an alternative section to the Find dialogue box. Each of the icons which appears here may be selected to insert the appropriate code character into the Find or Replace string. And in this mode (following Acorn's Source Edit), the special characters are usually just a single character. The backslash is now used to indicate that the character which follows it has its normal ASCII meaning. Thus, for example, while "&" means "Replace string", "\&" means the ampersand character "&". This is the reverse of Edit emulation mode.

The following characters have special meanings in Power search mode:

Some examples will make this clearer. The search string:

will match "disc09", "disc19", "disc29" etc. but not "discs9" or "disc91"; while
will match "disc" and "disk" but not "dist".

To count the number of numbers (as opposed to raw digits) in a file, use the search string %# and click on Count. To reduce multiple spaces in a program to single spaces, use a two character search string of a percent followed by a space, and a replace string of a single space.

To remove all REMs in a program, use the following search string:

and a Replace string of:
Translated into English, the Find string looks for "zero or more spaces followed by zero or more colons followed by zero or more spaces, followed by the letters REM followed by zero or more occurrences of characters which are not newline characters, followed by a newline".

A final example will clarify the use of the "?" field code. This specifies a particular ambiguous element from a Find string for use in a Replace string. If you search for:

and use a Replace string of:
the actual Replace string inserted will be that which follows the letters "REM", since this is the fifth ambiguous element in the Find string (the first is referred to with "?0").

GoTo
The GoTo option allows you to go to any specified line. Just enter the number of the required line relative to the start of the file, and press Return, or click on OK. Line numbers begin at 1, and increment by ones. So if you are editing a Basic program which is numbered by tens, then to move to line 2650, enter the number 265 in the GoTo dialogue box.

Incidentally, the GoTo dialogue box also displays the current line number, and the current character number. This can sometimes be useful.

Undo
This useful feature allows you to undo any sequence of actions which has been carried out in DeskEdit. By repeated selection of Undo (or the pressing of F8) you will systematically undo the most recent actions which have been carried out. For example, if you have moved the caret down two lines, and then deleted a word, the word will first be reinstated, then the caret will move up two lines. There is a built in limit to Undo, determined by the length of the Undo buffer. By default this is set to 5K, but may be altered by using DeskEdit$Options - see section 5.5.

Redo
Each time you select this option (or press Shift-F8), you will undo an Undo. Between them the Undo and Redo options provide a useful safety net for any file which you are editing.

In addition, there is a special undelete buffer. This provides complementary features. See section 5.2.

CR<->LF
Selecting this option, or pressing Ctrl-F8, replaces all newline characters with carriage returns, and vice versa. Repeating the action reverses the effect.

The reason for this feature is that while (like Edit), DeskEdit separates each line of text with a newline character (ASCII 10), other text editors, and notably those on the BBC Micro, use carriage return characters (ASCII 13). To make text from such an editor legible in DeskEdit, you will need to make use of this option. But if you are editing the text for use on the original system, do not forget to return it to its original state before saving it.

Expand tabs
Selecting this option causes each occurrence of the Tab character (ASCII 9) to be replaced by the number of spaces (any number between 1 and 8) required to tab out to the next natural Column tab position. This action is not reversible, and is only of use with files from other systems which make use of ASCII 9. DeskEdit does not use ASCII 9. If you press the Tab key, the caret will simply move by a number of spaces depending upon its current position, and whether Column tabs is selected. The Expand tabs feature has only been included for compatibility with Edit.

Format
This is an important feature for those using DeskEdit to edit plain text, but should not be used when editing program source code. If you select this option from the Edit submenu, you will see a dialogue box containing a Format width. By default this is 76 characters, but you can set it to any value that you wish. Every time that you select Format, or press Ctrl-F6, text from the caret down to the next format break will be formatted to the specified width.

A format break occurs at any point where DeskEdit cannot confidently continue to format. This occurs at what are taken to be paragraph breaks (the occurrence of two adjacent newline characters), or where text appears to be intentionally indented (the occurrence of a newline character followed by one or more spaces).

When DeskEdit formats a block, it renders it ragged-right to the given line width. Formatting will always be wordwrapped, even if you do not have Wordwrap selected at the time.

If you are typing text in Wordwrap mode, you should not need to format it unless you want to alter the line width, because formatting is carried out as you type - whether you are simply adding new text, or are editing text in some way. For further details, see section 6.1.

2.5 Display

The ten items in the Display submenu are, as you would expect, concerned with the look of a text window rather than its contents.

Font
Moving the pointer across the Font entry displays a submenu of all fonts known to the font manager. The default is the standard 8×8 system font. This is the font to use for all source code, whether in Basic or C.

Font size and height
These two options are only selectable if you are using outline fonts (see above). They allow you to select the the point size of the font and its height from submenus offering sizes of 8, 10, 12, 14 and 20 points.

Line spacing
This allows you to adjust the line spacing used for the display. The number entered is the number of pixels adjustment required, and may be positive (to increase spacing) or negative (to reduce it). The default is zero.

Margin
This option allows you to set the left-hand margin of the displayed text in pixels. By default it is zero.

Invert
Selecting this option alternately swaps foreground and background colours used for a particular window.

Window wrap
Window wrap determines how DeskEdit will behave if you are dealing with text which is wider than the visible window. It is intended mainly for use with program source code rather than plain text, and when activated will wrap text onto the next line so that no text is invisible because it goes beyond the right-hand edge of the window. It should be stressed that unlike the Wordwrap option this does not insert codes into the text itself: only the way in which the text is represented on screen is affected.

Foreground and Background
These two options cause colour selection submenus to appear which allow you to choose the foreground and background colours of individual windows. The default foreground colour is white, and the background black, but other defaults may be set by using DeskEdit$Options (see section 5.5).

Work area
This option allows you to set the work area width of a given window. The number supplied is a number of system characters (even if you are using outline fonts). This option is useful for editing source code which uses a width greater than your current screen mode allows. Without this option, you cannot have a DeskEdit window wider than the screen.

This option is also useful for restricting the width of DeskEdit windows when using the wider screen modes. With this option in place, and a width set to 76 characters, you can use mode 16 for example, and when you click on the full size icon, the window will no longer unhelpfully expand to cover the full width of the screen.

3 The Window Menu Entries (lower)

3.1 Help

Pressing F1, or selecting the Help option from the menu causes the help system to be displayed. This is a reasonably full on-screen mini-manual. It begins with a contents list giving a summary of the features covered.

3.2 Language

DeskEdit can operate in three possible language modes:
The first is used for text documents of all kinds, and indeed for any type of file which does not fall into the category of Basic program or C source code, dealt with by the remaining two options.

The following features are language-specific:

The currently selected language mode for the DeskEdit window with input focus is indicated on DeskEdit's icon bar icon - with a "T" for Text, a "B" for Basic or a "C" for C. This will be altered as different windows gain input focus.

When new files are loaded, DeskEdit makes an intelligent guess at the appropriate language mode. Basic is easy to spot, while C is used for any text file whose first two characters are "/*".

When a new file is created with the Create option on the icon bar menu, the language mode assigned will be based automatically on the type of file selected. But you can also alter the language mode for any resident file by using the Language option on the window menu of the object. A tick shows the current setting.

Further leaves of this menu also allow you to set language-specific options such as automatic indentation and syntax checking - see sections 3.22 and 3.24 below.

The User Choices dialogue box (move the pointer across Choices on the icon bar menu - or press Ctrl-Shift-F10) also controls the behaviour of certain language-specific options. These largely duplicate the effect of the options from the Language submenu, but with the option to save the choices for future use. One feature controlled by the dialogue box but not the language submenu is the default language. This is simply the language assigned to new windows created by clicking on the icon bar icon. It may be set to Text, Basic or C. By default it is set to Text.

3.21 Macros and Key-based Features
Macros are only language dependent in the sense that there is a complete set of ten text macros allocated to each of the three language modes. Thus if you are in Text mode you have one set of macros, while if you switch to Basic, an entirely different set will come into force. See section 3.7 for further details.

One or two of the keyboard features are language specific. In Basic mode the following take effect:

In C the following are effective:

3.22 Auto Indent
Auto indent may be set for any or all of the three language modes. If it is operative, then when you press Return, an indent in the previous line will be followed.

If a line ends with a colon, then an indent two spaces greater than that of the previous line will be created.

Pressing Shift-Return will produce an indent two spaces less than that of the previous line.

Pressing Ctrl-Return will perform an ordinary Return.

Pressing Ctrl-Shift-Return will toggle the auto-indent feature for the currently selected language. If sound is enabled, a high beep denotes Off, while a low beep denotes On.

3.23 Basic Import / Export
Basic programs are normally stored in so-called Tokenised form. If you drag a Basic program file to DeskEdit's icon bar icon, it will automatically be de-tokenised, to render it into textual form before it is displayed in a new window ready for editing.

If you have the Strip line numbers option set (use the Choices entry in the icon bar menu to alter this), line numbers will be removed when Basic programs are loaded into DeskEdit. This makes editing a little easier, but this option is only possible if the program contains no specific line number references (e.g. no GOTOs etc.). If the program contains GOTOs you will get an error message, and will need to de-select the Strip line numbers option.

To save your edited program, either press F3, or use the window menu, following the sequence: Language then Basic then Save. If you want to save the program under its original name, just press Return - otherwise, edit the supplied name first. If you were using stripped line numbers, these will be reinstated, and the program renumbered by tens. If you did not strip line numbers, but saved a program with out-of-sequence line numbers, or with some lines without numbers, then again the program will be renumbered as it is saved.

Note that if you use the Save option from the upper half of the window menu, your program will be saved without re-tokenising, as a file of type &FD1 (BasicTx) with a very different looking icon. Such files can be loaded into DeskEdit at any time, for further editing, but unlike tokenised Basic files, they may not be run by double-clicking on them.

If you drag a tokenised Basic program into a DeskEdit window rather than the icon bar icon, then the file will not be de-tokenised, and will be loaded (or appended) byte-for-byte as it appears in the file. If you want to append the whole or a part of one program to another, first load the two programs separately into DeskEdit by dragging their icons from a directory viewer to DeskEdit's icon bar icon. Then select a part or the whole of the program to be appended. Then use the Copy option.

3.24 Syntax Checking
Syntax checking is available for both Basic and C source. To switch it on, either use the Language submenu, or the User Choices dialogue box. More simply, pressing Ctrl-Q (for Quick syntax checker) will toggle the feature on and off. If sound is enabled, you will hear a low beep when it is turned on, and a high beep when it is switched off.

Additionally, the Syntax Window will appear at the top right of the screen with a message to this effect.

If syntax checking is enabled, checks will be made whenever Return is pressed, or whenever you use the Up or Down cursor keys to move away from a line which you have just edited. If an error is detected (or suspected), a high pitched beep will be heard (if sound is enabled), and the syntax window will appear with an appropriate message. The box will disappear at the next keypress.

For further details on the Syntax Checker, see sections 6.2 (Basic) and 6.3 (C).

3.3 Quick Search

Quick Search is activated from the window menu or by pressing Ctrl-F4 or Ctrl-Shift-F4. The latter is identical to the former, except that (as with the Quick search menu option) the previous search string is automatically written into the dialogue box before it is displayed.

To use Quick Search, just enter your search string into the dialogue box, and press Return (or click on OK or press F1). A find will be signalled by a low beep (if sound is enabled) and a rapid blinking of the caret for a couple of seconds (if this User Choice option is selected). To search for further occurrences (at any time) press Ctrl-N.

The Quick Search options are intended to provide a useful alternative to the Search and Replace feature (see section 2.4), over which it has the following advantages:

  1. It does not mark finds using the standard inverse video marking, so previously selected (or marked up) sections are left intact ready for copying or moving etc.
  2. Less key pressing is required for each search, and no dialogue box appears when finds are made (this sometimes hides the find in the Find Text option).
  3. Repeat searching is very quickly activated (using Ctrl-N for Next). Thus, for example, if you make a series of finds, and need to manually edit the text at each, you can perform your editing, then press Ctrl-N to move you to the next occurrence, and so on. Using Find Text, you would need to press F4, then F2, then press Return twice, and finally Escape to remove the Found dialogue box for each find. The sequence F4-F2-Return-Return-Escape can be replaced by a single press of Ctrl-N.

Because of its speed and ease of use, Quick Search is ideal for finding a particular reference in a file - for example a miss-spelt word which you need to edit, or a particular variable or function name in a program's source code.

3.4 Clipboard

DeskEdit features a clipboard which can hold any amount of text (subject to RAM availability via the Task Manager), and which will work across any of the editor's windows. It may be controlled in one of two different ways:

  1. From the menu
  2. From the keyboard using Ctrl-Shift keys

In each case, text to be copied to the clipboard must be marked in one of the ways described in section 1.3. Text copied to the clipboard is always appended, so you may wish to clear the clipboard before some append operations. When text is pasted into your document, it will appear at the caret, so you will need to position this before embarking on a Paste operation.

The Menu
To use the Clipboard from the menu, make sure that the window which you are editing has input focus, click Menu over the window, and move the pointer across the Clipboard entry. This displays a submenu with five Clipboard options. Some of these will be shaded if they are not applicable. For example, Append to clipboard will be shaded if there is no marked text in the window with input focus.

The Ctrl-Shift Keys
If Ctrl and Shift are both held down, then the following five keys will operate the clipboard as described:

Note the broad similarity of the use of the five keys on marked blocks (when used with Ctrl on its own).

3.5 Position Finding and Indexing

When a file grows to any size, whether it be a text file or a program source of one kind or another, finding your way around it can become inefficient and time consuming. For this reason, DeskEdit provides three different mechanisms to meet this need:

  1. Dynamic markers. Here, a number of dynamic markers can be placed in any document, so that simple keypresses can take you instantly to the required point.
  2. Specific finders. This feature allows a number of control key presses to take you to predetermined points in a document at which you have placed a special character sequence. For example, Ctrl-! takes you to the first occurrence of "REM!" if you are in Basic mode.
  3. User Index. This feature allows you to set up an index anywhere in a document in such a way that positioning the caret beside a particular entry will take you to a corresponding point in the body of the document.

Dynamic Markers
DeskEdit provides three dynamic markers per window. These are controlled by F9, F10 and the Home key. Pressing Shift-F9 inserts marker 1 into the text at the current caret position. Shift-F10 inserts marker 2. The markers are invisible, but if sound is enabled, you will hear a confirmatory beep.

Pressing F9 at any time will then take you to marker 1, while F10 will take you to marker 2. Pressing Ctrl-F9 will take you back to the position from where you last executed an F9 jump. Thus pressing F9 and Ctrl-F9 will alternately take you between two positions. F10 and Ctrl-F10 behaves in a similar way.

Alternatively these options can be set from a dedicated dialogue box by selecting Markers from the window menu, or by pressing Ctrl-Shift-F9.

The Home key takes you to the top of text, and Ctrl-Home takes you to the end of text. Shift-Home takes you to where you were when either of these Home options was last called. If you do not make use of the Home key in the normal course of events (by using the alternative Ctrl-Up to take you to the top of text and Ctrl-Down to take you to the bottom), you can use this feature as a third Go-to marker. Move to the position that you want to recall, and press Home. Now every time that you press Shift-Home you will be taken there.

Specific Position Finder
Ctrl-Shift together with any symbol key on the top line of the keyboard will take you to special textual markers previously set up in your text.

For example, Ctrl-Shift-! will take you to the first occurrence of:

Ctrl-Shift-@ will take you to REM@ in Basic mode, and so on.

To make use of this feature, simply place sequences such as REM! at vital points within your source code. The search is carried out from the top of text, rather from where you happen to be when the search is initiated.

If you wish to search for further occurrences of the sequence, use Ctrl-Shift-N (N for Next).

Note that the keys /, *, #, -, + and full stop, all on the numeric keypad, also work in this way.

Indexing Finder
Function key F11 is a generalised indexing finder. It is intended to work from a menu which you create, say, at the top of a document, and will take you to a matching word anywhere in the text.

When you press F11 (or the alternative Alt-Select), the first "word" after the caret is taken as the search string, and you will be taken to the next occurrence of this string in the body of the document. For example, if you put the caret to the left of the following line:

(which would ideally be located in a special menu area at the top of text), and press F11, you will be taken to the next occurrence of "REMmp". Hopefully, there would be something like:
in the main body of your code.

You can thus have a whole menu in REMs at the start of a Basic program (or their /* */ equivalent in a C program) allowing you to move to a required procedure or function at the touch of a key.

This feature has been used extensively in developing the C source of DeskEdit itself. Here is a small part of the first lines of the source:

/* 
 **key   keypress handler              **in   initialise
 **fk    func keys (keys above 127)    **lk   low keys
 **me    mouse events                  **main main()
 **lc    load choices                  **wf   window functions 
 **mw    main window events            **sw   syntax wind events
 **ue    unknown event processor         
 **ich   icon click handler (icon bar) */

To find the section of code dealing with the keypress handler, I just move the caret to the left of **key, and either press F11 or use Alt-Select, and I am immediately taken to the corresponding section in the body of the source code (which is marked with the same characters "**key"). If I want to go back to this point frequently, I can mark it more permanently with the F9 or F10 markers.

For a text document, the menu can take the form of a contents list:

If you place the caret to the left of the first entry, and press F11 you will be taken to the line in the text containing "1.1". For example, the line:

In preparing this manual using DeskEdit, I have again made extensive use of this feature. The first page, which contains the contents list, acts as the menu, and gives instant access to all sections referred to - since the sections themselves use the same numbering system.

Note that these searches are case sensitive, and that further finds can be searched for at any time by pressing Ctrl-Shift-N (N for Next) - not to be confused with Ctrl-N which takes you to the next Quick Search find.

Searching normally starts at the point where the user index is located, and continues until a find is made or the end of text is reached. This enables the creation of sub indexes lower down a document. But if you call the index search using Shift-F11, the search will begin at the start of a document.

3.6 Set Filetype

This option allows you to set the filetype of any file currently loaded into DeskEdit. Moving the pointer across this option on the menu displays a list of filetype numbers and names. The one corresponding to the current file will be ticked. To alter its filetype, just click on the desired entry. To set the type to one which does not appear in the list, scroll to the bottom of the list, and enter the required type (as a hex number in upper or lower case), and press Return.

You will need to take care when altering filetypes, as there may be unforeseen consequences. In particular, if you change the filetype of a Basic program (which will be of type BasicTx when in DeskEdit), you will no longer be able to save it as a tokenised program.

If you wish to create a new Basic program, the best way to do this is to use the Create option from the Icon bar menu (see section 4.3).

The list of filetypes which appears in the menu is derived from a data file (!DeskEdit.Data.FTypeTable), and you may edit this to your own requirements, providing that you do not exceed a maximum of 30 entries. But note that this file is only read once when DeskEdit boots up.

3.7 Text Macros

Up to ten text macros may be defined for each of DeskEdit's three language modes, and these may be inserted anywhere in the text at any time with a single keypress. The macro facility uses the keys 0-9 on the numeric keypad. Pressing Ctrl-<N>, where N is a keypad key in this range, will insert the macro into your text at the caret; while pressing Ctrl-Shift<N> will display a dialogue box showing the current setting of macro number N. If you wish to alter it, then type into the writable icon, and click on OK or press Return when you have finished. Ctrl-U will clear the writable icon for you to enter an entirely new text string.

If you wish to enter a new line, then use the three character sequence <|>. This will be translated into a new line when the macro is inserted into your text. Any number of new lines may be used subject to space. And since each macro may be up to 250 characters in length, great flexibility is provided. You could use macros for entering keywords in Basic, or any other language. You could even enter whole structures such as a Basic CASE statement or a switch in C. You could use one macro for your address and telephone number to go at the top of a letter, or indeed for an outline letter complete with Yours sincerely etc. at the end.

A special dialogue box is also provided for you to take stock of all ten macros for the current language. Either press Ctrl-F1 or select the Macros option from the window menu. To insert any macro into your text, just click on the corresponding Insert icon. To alter a macro, just click on the editable icon for the given macro, and type the required text - again Ctrl-U will delete the current entry. When you have finished, click on Exit and Update if you wish to retain the editings, or Exit, Update and Save if you wish to save your macro files to disc for future use. Note that all three language macro files are saved by this single action.

You may also, if you prefer, load your macro files into DeskEdit for direct editing. The files are in the directory !DeskEdit.Choice, and are named:

3.8 Printing

DeskEdit makes use of Acorn's version 2 printer drivers to permit text to be printed in a reasonably flexible way. Graphics printing is not used, and outline fonts - even if used in the display - will not be rendered in the printout, but the user can enter printer codes in any text object for Bold, Light, Underline or Italics. Additionally, page breaks, and conditional page breaks can be incorporated.

Headers and footers are implemented, and these can contain page numbers, filenames, times and dates in any combination. Additionally, headers and footers can be left or right aligned or centred, and may contain printer codes independently from the body of the text.

Two special dialogue boxes control the printing functions:

The former deals with page size, number of characters per line etc., while the latter, as well as controlling the actual printing process, offers a number of additional options including the generation of statistics. This allows you to see how many pages of text you have, before committing yourself to paper. There is also a Preview option, which generates a scrollable window containing an exact representation of what would normally be sent to the printer. This option should save a great deal of paper, because it allows you to get everything exactly right before engaging the printer.

Before dealing with these features, we must first look at the more mundane subject of printer codes.

3.81 Printer Codes
When in Text mode, the adjacent set of keys T, Y, U, I, O and P, when used with Ctrl and with Ctrl-Shift, generate printer codes as follows:

The codes appear in the text exactly as shown above, and are translated into the required effects when the DeskEdit printout option is selected from the Hardcopy dialogue box (see below). Codes may be used in any combination, so you could for example have a section of text in bold italic underlined.

Page breaks and conditional page breaks have been implemented using Ctrl-P and Ctrl-Shift-P respectively. The latter will cause a page break if it occurs within 6 lines of the bottom of text on any given page.

Note that the keys used for these operations are grouped together on the keyboard, and that in most cases the letter suggests the effect. U for Underline, I for Italics, O for Ordinary style, P for page break. T can be thought of as Thick (i.e. Bold), but Y is not really suggestive of light.

3.82 Page Set Up
The Page set up option from the icon bar menu (or Shift-Print from the keyboard) allows you to set up the way in which your text will appear on the page, including text height, width, the use of headers and footers etc.

The text height should be the exact number of lines which could in principle be fitted onto a page. The default is 68. The text width is the number of characters which your printer can accommodate on a single line. The top and bottom margins are the number of blank lines that you require (ignoring headers and footers) at the top and bottom of the body of text. The left margin and the alternate margin should be set to the same number of characters unless you require alternate pages to have a different left-hand margin - as you might if you were going to use double-sided photocopies of the printed output.

The overhang is the additional indent that you require for lines which exceed the stated maximum length. This should normally only happen with program listings and the like. The default is 2, meaning that split lines will be indented two characters to the right of normal lines. The overhang may also be set to a negative value, but should never take the line back further than the minimum margin set. Thus if you have set a left-hand margin of 4, the overhang should never be less than -4.

To save the current printer setup, move the pointer across the Save printer setup option on the icon bar menu. This will supply a "Save as" dialogue box allowing you to edit the name of the setup file. The default name is "PtrDefault". This is also the name of the setup file which is loaded when DeskEdit is first installed.

If you decide to edit the name used to save your data, you should only alter the so-called leafname (the characters to the right of the last full stop in the supplied name). This is because Page setup data is stored in a special directory (called Choices) within the DeskEdit application directory.

You will see that the file has a special DeskEdit icon, and if you wish to load a new setup file at any time, just drag the file's icon from a directory viewer to DeskEdit's icon bar icon. You will hear a confirmatory beep if sound is enabled. So that you can distinguish your printer setup files, it might be worth giving them names which begin with the letters "Ptr", but this is not essential.

Since dragging DeskEdit files (i.e. files with the DeskEdit icon like the setup file) to the DeskEdit icon causes them to be acted upon rather than loaded into a window ready for editing, we need a way to load them into DeskEdit in order to view or edit them. There are two ways to do this. Either drag the file to the icon with the Ctrl key held down, or open a new DeskEdit window by clicking on the icon bar icon, and then drag the setup file directly to the empty window.

3.83 Headers and Footers
The header and footer positions should be thought of as line numbers within the top and bottom page margins respectively. Thus if you have set a bottom margin of 4 lines, setting the footer position to 2 will place the footer on the second line after the body of text ends. To cancel a header or footer, set its position to zero.

Writable icons are provided in the Page setup dialogue box for entering the text for the header and footer. This can be a normal text string including spaces where appropriate. But special codes are also permitted, as follows:

Additionally, the following printer codes may be incorporated:

In the case of headers and footers, there is no single key shortcut for entering these codes.

Note that all codes may appear anywhere in the text that you require, but that the printer and position codes will affect the whole header or footer. Thus, for example the header:

will cause the text to appear in bold italics, and to be right justified, even though the justify and italics codes are at the end of the string.

DeskEdit ensures that header and footer printer codes do not interact with those used for the main body of the text.

When you are satisfied with the printer setup selections, click on the OK icon. If you click on the Cancel icon, or click outside the dialogue box, the settings will revert back to their previous values.

To save the settings for future use, click on the Save setup entry on the icon bar menu.

3.84 The Hardcopy Option
Selecting the Hardcopy entry in the icon bar menu, or pressing the Print key, puts up the Hardcopy dialogue box. This box allows you to set the range of pages to be printed (or previewed), and to determine how DeskEdit will deal with embedded DeskEdit printer codes. Use will turn them into the correct printer codes for sending to your printer. Show will simply reproduce them as they are found (thus <|B> will be printed literally as <|B>, and so on). The third possibility, Ignore will ignore them completely, neither printing them literally, nor turning them into printer codes.

Finally, there are four print actions to choose from:

Statistics displays a summary of information about the proposed printout, including the number of characters, words and lines - and most importantly the number of pages which would be used. If you have a program source, and are contemplating printing it out, it can be very useful to know exactly how much paper it will take up before you start things going.

Preview installs a new DeskEdit window containing an exact copy of what would be sent to the printer - except that print style codes are not included. This allows you to carefully check that all is as it should be before printing takes place. In particular, you can check line and page breaks, headers, footers and page numbering.

Literal print provides a way of avoiding the use of any of DeskEdit's features. It sends the file directly to the printer drivers, without processing it in any way. Even the margin and page length details will be ignored.

Full feature print is the default printout option for DeskEdit. It makes use of all the features outlined above, and will generate an exact copy of what appears in the Preview window, except of course that printer codes will be effective.

If a selection has been made in the text, you will be asked if the print/preview/statistics options refer to the selection only, or to the whole of the text. By making a selection, and then choosing the Statistics option, you can easily obtain character, word, line and page counts for arbitrary sections of text.

The features provided by DeskEdit require the use of Acorn's printer drivers, version 2.4 or later, and copies of these may be obtained from your local Acorn dealer. When you first install these, you will need to set the number of lines per page, and the number of characters per line to the same values as are used in DeskEdit (on the Printer Driver Page set up dialogue box), and you will also need to set the top, bottom and left margins to zero on the printer driver, and to turn off the Header option. You should then save these choices (to avoid needing to reset them each time you install the driver).

The reason for cancelling these options on the driver is to prevent the driver from trying to apply its own margins and headers from a text file which already contains them. The effect of this will be that any text file which you drag from the Filer to the driver will also use these settings. However, if you double-click on the text file instead, it will automatically be loaded into DeskEdit (providing that DeskEdit has been seen by the filer), and you can then print it directly from DeskEdit with all the defaults which you have set up. Of course, you could also reset the Driver's margins, but this could be a little tedious, and the printout facilities offered by DeskEdit are superior to those available through the printer driver on its own.

A better approach would be to keep two versions of the printer driver which you use: one with zero margins etc. for use with DeskEdit, and the other set up for printing normal text documents. You could then use DeskEdit's User Command menu to install the appropriate driver. If you are using floppies, it may well be worth keeping a copy of the DeskEdit version of your printer driver on your DeskEdit disc.

3.9 User Commands

Both the window menu and the icon bar menu have a User commands option. This places a submenu on the screen containing a set of user-defined options. These are driven from a special data file which you may edit to suit your own requirements. You may include options to start any new task (e.g. to install ArcScan or Ovation for example), to display any directory viewer on the Desktop, to launch any Obey file, or to send any command to the operating system.

These are very powerful features, and allow you to control your whole Desktop from a single menu. For example, by keeping an entry for each of your most frequently used tasks, you can run any of them very quickly indeed without having to get to the right point in your directory structure, and scroll directory viewers before finding the icon of your choice.

To set up this feature, you will need to edit the file:

This file contains full instructions for use in its remark lines (lines beginning with a backslash are ignored by DeskEdit).

Each non-remark line must consist of a menu entry of maximum length 15 characters, followed by an equals sign, followed by the command. The command may be up to 100 characters in length, and a maximum of 20 entries are permitted.

To start a new task, preface the task name with \s followed by one or more spaces. For example:

To open a filer window, use a preface of \f. For example:

To launch an Obey file, use a preface of \o For example:

The result of including the three lines given here would be a three-entry Command submenu with the following effects:

A bar "|" before an entry gives a dashed line above it in the menu. This is useful for visually separating groups of entries. The default Commands file supplied with this package uses this feature.

4 The Icon bar menu

4.1 Info, Help, Quit etc.

The icon bar menu contains entries which are not specific to any particular DeskEdit window. The Info option provides the usual information about the software package, including its version number and date, and this should be quoted in all correspondence.

The Help option provides on-screen help, and is also available from the window menus. The Page setup, Save page setup and User commands entries have been dealt with above.

The Quit option has the expected effect, and will remove DeskEdit from the icon bar. If any DeskEdit window contains modified (and unsaved data) you will be warned before the task is closed down.

Because such warnings can sometimes be unhelpful when you know what is at risk, a special option allows you to exit the package without the warnings. Just hold down the Shift key while clicking on Quit.

4.2 User Choices

Moving the pointer across this entry (or pressing Ctrl-Shift-F10) displays a dialogue box which allows you to control a number of options which affect the package as a whole - including language features, and caret control. These are dealt with specifically in sections 3.2 and 5.4, respectively.

The Sound option is not dealt with elsewhere. This simply allows you to switch on or off the Sound feature. When enabled, you will hear confirmatory beeps during various DeskEdit activities. For example, pressing Ctrl-Shift-Return toggles the auto indent feature. When it is turned on you will hear a low beep - providing that sound is enabled - and a high beep when it is disabled.

The three icons at the bottom of the dialogue box are fairly self-explanatory. The middle one will update your choices, while the rightmost will both update them, and save them to a file so that they can be used next time that DeskEdit is invoked.

4.3 Create New Object

Moving the pointer across this entry opens up a submenu of options, for creating a new file. The following are offered:
To create a file of a different type, use the first option - Create Text file - then use the Filetype setting option from the window menu to establish the required filetype.

5 Miscellaneous Features

5.1 Entering Control Codes

Pressing Ctrl-Shift-F8 toggles the Control Codes option. By default it is off, allowing the use of DeskEdit's wide range of keyboard shortcuts. With Control Codes on, you can use the Ctrl key in combination with other keys to generate special control codes.

Alternatively you can enter them by holding down the Alt key and entering the ASCII value of the required code in decimal at the numeric keypad, and then releasing the Alt key (again this will not work for the majority of control codes when the Control Codes option is off).

The following keys can still be used as normal in this mode:

The ASCII values for carriage return, newline, delete, and backspace may still be entered however, using the Alt key. Thus to enter 127 (delete) hold down the Alt key, and enter the number 127 on the numeric keypad, and then release Alt.

Note that while the Return key has a key value of 13, it actually enters the ASCII value 10 into the text. This appears as a new line, and no character is displayed. If you enter the value 10 at the numeric keypad with Alt pressed, you will therefore get a new line, while entering 13 will give the sign for ASCII 13 "[0d]".

5.2 Undelete

All text deleted with Delete, Backspace, Copy, Shift-Copy and Ctrl-Copy is stored in an undelete buffer. The main purpose of this is to allow the simple movement of text by deleting it, and then inserting it elsewhere. The undelete buffer works in a different way from DeskEdit's Undo facility. The Undo option exactly reproduces a sequence of the last operations in reverse order. This means that if you delete some text from a particular position, Undo will reinstate it exactly where it was.

To use DeskEdit's Undelete feature, just position the caret where you want to insert the deleted text, and press Insert to insert a character at a time, Shift-Insert to insert a word at a time, or Ctrl Insert to insert a line at a time. The buffer is organised so that text deleted backwards with the Delete key, and text deleted forwards with the Copy key both re-emerge in a useful order, as far as possible.

Attempting to use Insert when the buffer is empty produces a warning beep if sound is enabled.

A special option is provided for clearing the buffer. Just press Shift-Ctrl-Copy. A low beep signals that the operation has been performed. It is sometimes useful to clear the buffer before deleting sections of text that you know you want to reinsert elsewhere, since it will avoid previously deleted characters appearing at the end of the undelete sequence.

The undelete buffer is cyclic, and is 5K in length.

5.3 The Dragging Options - File Info & CSD

Icon Dragging
Dragging a file to the DeskEdit icon will cause that file to be loaded into a new DeskEdit window. If it is a Basic program it will be de-tokenised first, and will assume a filetype of &FD1 (Basic Text).

The only exception to this is files of type DeskEdit (type C62): these carry the special DeskEdit file icon, and dragging one of these results in the file being acted upon in some way, rather than being loaded into a window for editing. For example, if you drag a printer setup file to DeskEdit's icon, a new set of printer setup data will be read in from that file. To load such a file into DeskEdit for editing purposes, drag the file to DeskEdit's icon bar icon with the Ctrl key held down.

Setting CSD
If a directory is dragged to the icon bar icon, a blip will be sounded, and the dragged directory will become the currently selected directory.

File Info
If the Alt key is held down when any object is dragged to the DeskEdit icon bar icon, an information box will appear giving filetype, length and timestamp of the dragged object.

Dragging to a Window
Any file dragged to an DeskEdit window will be inserted at the caret position. In this case, no special conversions will be carried out, and Basic programs will not be de-tokenised (and will therefore not be editable). To insert or append a Basic program (or a part thereof), see section 6.2.

5.4 The Caret Controller

DeskEdit contains software to flash the Archimedes' vertical text cursor known as the caret. This can make it much easier to find in a sea of text. To alter the caret flash options, click Menu over the icon bar, and move the pointer across the Choices entry. To turn on the flasher, select Caret flash. If input focus belongs to an editable DeskEdit window, the caret will begin to flash.

If you select Flash icons it will also flash when it is displayed within an icon. This is not usually necessary, since the caret is never hard to find when constrained to a writable icon.

If you select Flash apps in addition to Caret flash then the caret will flash whether it is owned by DeskEdit or not. This can sometimes be useful if you are running another text processing application - such as a DTP package - which does not have the ability to flash the caret.

If you select the Flash finds entry, then finds in the Quick search and Position finder will be signalled by a rapid flashing of the caret, even if normal caret flash is not enabled.

You can alter the flash speed by clicking on the arrow icons accompanying the Time on and Time off entries (use the Adjust button so as to keep the dialogue box on screen). When you are happy with your selections, click on Update, save and exit to save the selections for future use.

5.5 DeskEdit$Options

By setting the environment variable DeskEdit$Options, you can further customise aspects of DeskEdit. The table below gives the range of features which may be set up in this way:

LetterFeatureValue if unspecified
FText colour7
BBackground colour0
WFont width10
HFont height10
MLeft margin in pixels0
LExtra spacing between lines0
RWord wrapno wrap
NFont namesystem font
USize of undelete buffer5000 bytes

As an example of how this works, the following line in DeskEdit's !Run file is used to set the foreground colour of DeskEdit windows (i.e. the text colour) to white, and the background colour to black:

It sets the foreground to colour 0 (white) and the background to colour 7 (black). To set the background to dark blue, use B8 etc.

To alter the way in which DeskEdit starts up, you will need to open the DeskEdit application directory (double-click on the DeskEdit icon in its directory viewer with the Shift key held down). Then drag the !Run file into DeskEdit, and edit it accordingly - remembering to save it back again afterwards.

For example, to keep the present colour scheme, but turn on word wrap and set an Undelete buffer size of 10000 bytes, use:


These changes will not take effect until you next install DeskEdit. Additionally, not that if the environment variable DeskEdit$Options has not been assigned a value (because there is no reference to it in DeskEdit's !Run file for example), then DeskEdit will make use of the options currently set up for Edit in the variable Edit$Options - should this variable happen to be assigned.

6 Getting the Most from DeskEdit

6.1 Working with Text

Automatic Wordwrap As You Type
The key to working with text using DeskEdit is the interplay between Wordwrap and the format width. Before any text session, you will need to set these appropriately. Format width is set from the Edit entry in the window menu. Move the pointer across the Format text entry, and enter the required width of your text.

It is tedious to have to reformat to some other width at a later stage, so it is worth getting this right straight away. You will need to select a width which allows you enough room on your printer paper, taking into account any left-hand margin that you may require. This latter will be set on the Page Setup dialogue box when you come to print out your work.

To take an example, suppose that you want a left-hand margin of 4 characters, and your printer will handle text up to 77 characters wide, you must set the Format width to 73 at the very most. If you require a small margin on the right-hand side of the page, you will need to reduce this a little. Perhaps 70 would be a good width to go for in this case. Now select Wordwrap by pressing Ctrl-F5, and the job is done.

Because DeskEdit has no way of knowing how you want your text formatted, it will not always do it the way you want it. In particular, if you have a heading, and normal text without a paragraph indent follows on the line immediately below the heading, it will format the heading in with the body of text if alterations are made to the heading itself. The simplest way to avoid this is either to indent the line after such a heading (e.g. by indenting all paragraphs), or to place a blank line after the heading. Otherwise, switch off Wordwrap by pressing Ctrl-F5 just before editing the heading, and then switch in on again afterwards with a second press of Ctrl-F5.

Note that if you do get unwanted formatting at any time, you can just hit F8 (Undo) to return your text to its former state.

A key factor worth remembering is that whether formatting is activated by pressing Ctrl-F6, or by Wordwrap as you type, the section formatted always starts at the caret and works down the screen. No text before the caret is ever formatted; and formatting ends where a newline is followed either by another newline, or by a space.

DeskEdit does not reformat when Return is pressed, so if you are splitting a line using the Return key, you will need to reformat the following text. The most effective way to do this is to use Ctrl-F6 (Format block).

If you are typing into a line which already contains text to the right of the caret, make sure that there is at least one space immediately to the right of the caret. This will ensure that correct formatting is achieved first time - otherwise the word which you are typing will be joined to text already present, and formatting will be performed on the basis of the combined length of this "word".

If you wish to insert a pad character in order to join two words which must not be broken over a new line, just use Alt-space. In other words hold down the Alt key, and press the space bar. This inserts character 160 which looks identical to a space, but which is treated differently by the formatter.

6.2 Working with Basic

If you are going to type in a new Basic program from scratch, first use the Create option on the icon bar menu, and click on New Basic file. This will create a new DeskEdit window, set it to the correct filetype (i.e. FD1 BasicTx - de-tokenised Basic), and put you in Basic mode.

If you are loading a Basic program from disc, just drag its icon to DeskEdit's icon bar icon. If you have selected the Strip line numbers option, then line numbers will be stripped as the program is de-tokenised ready for editing. However, if your program has direct line number references (such as GOTOs etc.), this is not possible, and an error message will appear. You will then need to deselect the Strip option (use the icon bar menu entry Choices) and try again.

It is much easier to edit with the line numbers stripped, and it is likewise good programming practice to avoid the use of GOTOs.

When editing Basic you will need to ensure that the Wordwrap option is Off (this is the default) - check that the word Wordwrap does not appear in the window's title bar.

Most of the features of DeskEdit will be useful for editing Basic programs. The various position finders will help you to find your way around your code (see section 3.5), while the wide range of Search options will also be very useful.

One or two features are specifically for use in Basic mode. The Syntax Checker can be used to perform simple syntax checking as you type (in fact checks are made when Return is pressed, or when you press Cursor Up or Down after editing a line). Checks are made to verify that parentheses and quotation marks match, and that certain keywords are correctly used.

Additionally the following features are implemented:

Thus for instance, to move to the start of each function and procedure definition in your program in turn, just press Ctrl-Shift-D to move to the first, then Ctrl-D to move to each subsequent one.

Basic has its own set of ten text macros. The first four of these are initially set to create a dashed REM line, and to generate the keywords DEF PROC, DEF FN and ENDPROC, respectively - but each may be defined to hold any string of up to 250 characters in length to suit your own requirements.

Finally, remember the Save File shortcut. This is F3, and it will automatically re-tokenise Basic programs as an integral part of the Save operation, rendering them into a state ready for running. When you are editing Basic, it is a wise precaution to use F3 at regular intervals (just press F3 Return) to keep your work safe. To test a program that you are developing, keep its icon visible, and double-click on this to run the program after saving it using F3. Alternatively, use the User Commands feature (see section 3.9) to launch your test program or application from DeskEdit's icon bar menu.

6.3 Working with C Source Code

If you are going to type in a new C source code file, first use the Create option on the icon bar menu, and click on New C file. This will create a new DeskEdit window, and will set the correct filetype, and put you in C mode.

If a plain text file is loaded into DeskEdit, it will be assumed to be C source code if the first two characters in the file are /*. These are used in C to begin a comment. If you expect to be loading a source file back into DeskEdit at a later date, then it is worth ensuring that these two characters are indeed the first two in the file - otherwise you will need to use the Language option on the window menu to set the language mode to C.

When in C language mode, the C text macros come into effect - for example, try pressing Ctrl-0 (using the zero of the numeric keypad) when you have input focus on a DeskEdit window in C mode. A remark line consisting of a series of dashes will be inserted into your source - useful for separating off one piece of code from another. Ctrl-7 and Ctrl-8 (again both at the numeric keypad) generate the useful #if FALSE and #endif pair of preprocessor directives. Other macros are also defined - and of course you can redefine all ten to suit your requirements (see section 3.7).

In C language mode, Ctrl-{ and Ctrl-} will insert the three character sequence "/* " and " */" to open or close a comment, respectively.

The auto-indent facility is also particularly useful when writing C source code. This feature is toggled by Ctrl-Shift-Return and may also be enabled or disabled from both the C submenu of the Language entry in the window menu, and from the Choices dialogue box (which also permits your selections to be saved for future use).

When Auto indent is switched on, pressing Return will cause the new line to be indented to match the present line. Using Shift-Return reduces the generated indent by two character positions, while Ctrl-Return generates a new line with no indent whatsoever.

Use of this feature enables you to create blocks of aligned code - important for clarity of meaning. A further feature automatically inserts indents under certain circumstances e.g. when Return is pressed on a line ending in a colon or an open brace. These features automatically generate the style of indentation frequently used in C source.

For example, if you type:

and press Return, an open brace will automatically be inserted on the next line to give the following:

Pressing Return again will start a new line indented beneath the brace. If the following two lines were:

then these would automatically be indented and aligned. The result would be the following:

And in this the open brace and the two indents have been automatically generated by DeskEdit.

The Syntax Checker
To switch on the C Syntax Checker, either use the Language submenu, or the User Choices dialogue box. More simply, pressing Ctrl-Q (for Quick syntax checker) will toggle the feature on and off. If sound is enabled, you will hear a low beep when it is turned on, and a high beep when it is switched off.

Additionally, the Syntax Window will appear at the top right of the screen with a message to this effect.

If syntax checking is enabled, checks will be made whenever Return is pressed, or whenever you use the Up or Down cursor keys to move away from a line which you have just edited. If an error is detected (or suspected), a high pitched beep will be heard (if sound is enabled), and the syntax window will appear with an appropriate message. The box will disappear at the next keypress.

One way in which the Syntax Checker decides if a given line is within a comment is by looking at the sequence of Ctrl-Shift-{ and Ctrl-Shift-} pairs typed by the user. These respectively generate the sequence:

In C, the correctness of any given line is often context sensitive, and since this checker is line based, it is not able to check for context (which may not even be in place at the time that the check is made). It therefore makes educated guesses, and will sometimes warn when there is no error. Nevertheless, the Syntax Checker will help to avoid time wasted compiling code containing syntax errors.

7 Keyboard Shortcuts

To facilitate efficient use of DeskEdit, keyboard shortcuts are provided for many of its functions. As you become familiar with DeskEdit you will probably use these increasingly.

Some minor features - such as insert date and filename, park the mouse etc. - may only be operated via the keyboard.

Many of the shortcuts are function-key operated. These are not listed here, because the function keystrip supplied with DeskEdit should provide a satisfactory aide-mémoire.

Miscellaneous

Basic language-specific

C language-specific

Text Macros
The numbers 0-9 on the numeric keypad
See section 3.7 for further details.

Position Finder
Ctrl-Shift with any of the following:
takes you to special markers which you have previously inserted in the text. Eg Ctrl-Shift-! takes you to "REM!" if you are in Basic, "/*+!" or to "!" if you are in Text mode - assuming that this character or character is present somewhere in the text. Ctrl-Shift-@ will take you to "REM@" (or to "/*+@" or "@" for C or Text respectively. See section 3.5.

Marked Text Operations

The Clipboard

Printer Codes
The keys T, Y, U, I, O and P with Ctrl or Ctrl-Shift insert printer codes into the text. Generally Ctrl turns on a feature, while Ctrl-Shift turns it off:

Styles can be used in any combination.
Ctrl-O can be used at any time to kill all styles.

Mouse shortcuts